<template>
    <el-dialog
        :title="title"
        append-to-body
        destroy-on-close
        :model-value="showDialog"
        @close="closeDialog()"
        style="width: 80%"
    >
        <DockerImages :queryParams="rowData" :isShowDialog="true" />
    </el-dialog>
</template>

<script setup>
import { reactive, toRefs, defineProps, defineEmits } from "vue";

import DockerImages from "@/views/pages/builder/DockerImages.vue";

const props = defineProps({
    showDialog: {
        type: Boolean,
        default: true,
    },
    title: {
        type: String,
        default: "查看仓库详情",
    },
    rowData: {
        type: Object,
        default: null,
    },
});
const emit = defineEmits(["closeDialog"]);
const { title, rowData } = toRefs(props);
const closeDialog = () => {
    emit("closeDialog", false);
};

const params = reactive({
    backupId: "",
    sourceImageName: "",
    sourceImageVersion: "",
    sourceRepositoryId: "",
    tagRepositoryId: "",
    size: 10,
    current: 1,
    total: 0,
});

rowData.value &&
    ((params.backupId = rowData.value.id),
    (params.sourceRepositoryId = rowData.value.sourceRepositoryId),
    (params.tagRepositoryId = rowData.value.tagRepositoryId));
</script>

<style lang="scss">
.fl {
    float: left;
}
.p0 {
    padding: 0 !important;
}
.role_edit_item {
    width: 100%;
}
</style>
